package concurrent;

import java.util.HashMap;
import java.util.Map;

/**
 * @package concurrent
 * @Class Hello
 * @Description TODO
 * @Author zhangxinhua
 * @Date 20-1-15 下午5:11
 */
public class Hello {
    public synchronized static void start() {
        Thread thread1 = new Thread(new MutilThread());
        Thread thread2 = new Thread(new MutilThread());
        thread1.start();
        thread2.start();
    }

    public static void main(String[] args) {
        Hello.start();
        Map<String, Object> param1 = new HashMap<>();
        param1.put("name", "test");
        Map<String, Object> param2 = new HashMap<>();
        param2.putAll(param1);
        Hello hello = new Hello();
        hello.mapTest(param2);
        System.out.println(param2+""+param1);
    }

    public void mapTest(Map<String, Object> map) {
        map.remove("name");
    }
}
